<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
      <el-form-item label="设备名称" prop="deviceName">
        <el-input
          v-model="queryParams.deviceName"
          placeholder="请输入设备名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="设备编号" prop="deviceCode">
        <el-input
          v-model="queryParams.deviceCode"
          placeholder="请输入设备编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="检验部门" prop="deptId">
        <el-cascader
          :props="{ value: 'id', checkStrictly: true }"
          :show-all-levels="false"
          placeholder="请选择部门"
          v-model="queryParams.deptId"
          :options="deptOptions"
        ></el-cascader>
      </el-form-item>
      <el-form-item label="日期">
        <el-date-picker
          v-model="dateRange"
          value-format="yyyy-MM-dd HH:mm:ss"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          style="width: 240px"
          :default-time="['00:00:00', '23:59:59']"
        ></el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <!-- <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:user:add']"
          >新增</el-button
        >
      </el-col>-->
      <!-- <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:user:edit']"
          >修改</el-button
        >
      </el-col>-->
      <!-- <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:user:remove']"
          >删除</el-button
        >
      </el-col>-->
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['equipment:deviceCheckAsk:export']"
        >导出</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="info"
          plain
          icon="el-icon-upload2"
          size="mini"
          @click="handleImport"
          v-hasPermi="['equipment:deviceCheckAsk:import']"
        >批量导入校准费用</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="printBox"
          v-hasPermi="['equipment:deviceCheckAsk:print']"
        >打印</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-document-copy"
          size="mini"
          @click="handleClone"
          :disabled="single"
          v-hasPermi="['equipment:deviceCheckAsk:clone']"
        >克隆</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table
      @selection-change="handleSelectionChange"
      fit
      v-loading="loading"
      border
      :data="dataList"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column show-overflow-tooltip label="流程状态" width="100">
        <template slot-scope="scope">
          <el-tag size="mini">{{ scope.row.statusName }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column width="150" label="设备编号" :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <el-link @click="handleDetail(scope.row)" type="primary">
            {{
            scope.row.deviceCode
            }}
          </el-link>
        </template>
      </el-table-column>
      <el-table-column width="150" label="设备名称" :show-overflow-tooltip="true">
        <template slot-scope="scope">
          <el-link @click="handleDetail(scope.row)" type="primary">
            {{
            scope.row.deviceName
            }}
          </el-link>
        </template>
      </el-table-column>

      <el-table-column show-overflow-tooltip label="所属部门"  prop="deptName" />
      <el-table-column :show-overflow-tooltip="true" width="120" label="位置" prop="site" />
      <el-table-column
        :show-overflow-tooltip="true"
        width="120"
        label="管理人"
        prop="managerUserName"
      />

      <el-table-column show-overflow-tooltip  label="校准/计量检定有效期" prop="checkPeriod">
        <template slot-scope="scope">{{ scope.row.checkPeriod }}个月</template>
      </el-table-column>

      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
        width="240"
        fixed="right"
      >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            v-hasPermi="['equipment:deviceCheckAsk:info']"
            @click="handleDetail(scope.row)"
          >详情</el-button>
          <!-- v-if="scope.row.status === 'draft' || scope.row.status === 'end'" -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-if="scope.row.status === 'draft' || (scope.row.status === 'end' && scope.row.createBy == $store.state.user.id)"
            v-hasPermi="['equipment:deviceCheckAsk:edit']"
          >修改</el-button>
          <!-- <el-button
            v-if="scope.row.status === 'end'"
            size="mini"
            type="text"
            icon="el-icon-view"
            v-hasPermi="['equipment:deviceCheckAsk:add:log']"
            @click="handleRecord(scope.row)"
            >检测证书上传记录</el-button
          >-->
          <!-- <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['company:news:remove']"
            >删除</el-button
          >-->
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <!-- 打印模板位置 -->
    <PrintBox
      :pageNum="queryParams.pageNum"
      :total="total"
      :printRow="printList"
      :isVertical="false"
      :isPageSize="false"
      id="printBox"
    >
      <template slot="title" slot-scope="scope">
        <div style="margin-bottom: 0px">仪器设备计量检定要求表 STET/B/22-6</div>
      </template>
      <template slot-scope="scope">
        <!-- 表格  class  table-page  必须-->
        <table
          style="border-collapse: collapse"
          border="1"
          cellspacing="0"
          class="table-page"
          :isVertical="false"
        >
          <tr class="table_header">
            <td rowspan="2" colspan="2" style="width: 40mm;padding: 0; ">设备名称</td>
            <td rowspan="2" style="width: 20mm">设备型号</td>
            <td rowspan="2" style="width: 20mm">设备编号</td>
            <td rowspan="1" colspan="3" style="width: 60mm">对应设备检备编码</td>
            <td rowspan="2" style="width: 20mm">溯源方式</td>
            <td rowspan="2" style="width: 40mm">检定/校准有效期(月)</td>
            <td rowspan="2" style="width: 20mm">所属部门</td>
            <td rowspan="2" style="width: 60mm">位置</td>
          </tr>
          <tr>
            <td style="width: 20mm">公路工程</td>
            <td style="width: 20mm">水运工程</td>
            <td style="width: 20mm">建设工程</td>
          </tr>
          <tr>
            <td colspan="2" style="padding: 0;line-height:1.5;">{{ scope.item.deviceName }}</td>
            <td>{{ scope.item.spec }}</td>
            <td>{{ scope.item.deviceCode }}</td>
            <td>
              <div>{{ scope.item.highway ? '√' : '' }}</div>
              <!-- {{ scope.item.highway }} -->
            </td>
            <td>
              <div>{{ scope.item.water ? '√' : '' }}</div>
              <!-- {{ scope.item.water }} -->
            </td>
            <td>
              <div>{{ scope.item.build ? '√' : '' }}</div>
              <!-- {{ scope.item.build }} -->
            </td>
            <td>
              {{
              checkDict(dict.type.sys_trace_method, scope.item.traceMethod)
              }}
            </td>
            <td>{{ scope.item.checkPeriod }}</td>
            <td>{{ scope.item.deptName }}</td>
            <!-- <td>{{ checkDict(dict.type.sys_site_list, scope.item.site) }}</td> -->
            <td>{{  scope.item.site }}</td>
          </tr>
          <tr style="padding: 0">
            <td style="padding: 0;line-height: 1.5;;" colspan="2">设各检定/校准测试标准</td>
            <td colspan="9" style="padding: 0">{{ scope.item.checkRule }}</td>
          </tr>
          <tr style="padding: 0">
            <td style="padding: 0;line-height: 1.5;;" colspan="2">附加说明（试验规程）</td>
            <td colspan="9" style="padding: 0">{{ scope.item.otherExplain }}</td>
          </tr>
          <tr style="padding: 0">
            <td style="padding: 0" colspan="2">对应参数</td>
            <td colspan="9">{{ scope.item.param }}</td>
          </tr>
          <tr style="padding: 0">
            <td style="padding: 0" colspan="2">设备用途</td>
            <td colspan="9">{{ scope.item.useInfo }}</td>
          </tr>
          <tr>
            <td rowspan="4" style="width: 5mm; padding: 2mm; line-height: 13px">检验参数</td>
            <td rowspan="2" style="padding: 0;">规定项</td>
            <td>首检</td>
            <td colspan="8">{{ scope.item.fixFirst }}</td>
          </tr>
          <tr>
            <td>后续检查</td>
            <td colspan="8">{{ scope.item.fixNext }}</td>
          </tr>
          <tr>
            <td rowspan="2">必检项</td>
            <td>首检</td>
            <td colspan="8">{{ scope.item.mustFirst }}</td>
          </tr>
          <tr>
            <td>后续检定</td>
            <td colspan="8">{{ scope.item.mustNext }}</td>
          </tr>
          <tr>
            <td rowspan="2" style="width: 5mm; padding: 2mm; line-height: 13px">检定点要求</td>
            <td colspan="2" style="line-height: 2;">规范中有明确要求</td>
            <td colspan="8" style="max-width: 220mm;">{{ scope.item.request }}</td>
          </tr>
          <tr>
            <td colspan="2">无明确要求自行确定的</td>
            <td colspan="8">{{ scope.item.custom }}</td>
          </tr>
          <tr>
            <td colspan="3">其他要求</td>
            <td colspan="8">{{ scope.item.otherRequest }}</td>
          </tr>
          <tr>
            <td colspan="11">
              <div style="display: flex; justify-content: end">
                <div style="width: 50mm; position: relative">
                  填报人签名：
                  <img
                    style="width: 50px; position: absolute"
                    :src="$VUE_APP_IMG_API + scope.item.esign"
                  />
                </div>
                <div style="width: 50mm">日期：{{ checkHistoryNode(scope, "start").endTime }}</div>
              </div>
            </td>
          </tr>
          <tr>
            <td colspan="11">
              <div>
                <div style="display: flex; align-items: center; position: relative;padding: 0">
                  检测部负责人意见：
                  <div
                    style="
                      position: absolute;
                      top: 20px;
                      left: 150px;
                      text-align: left;
                    "
                  >
                    <template
                      v-if="CheckApprove(scope, 'jcbmfzr').ShowMessage"
                    >{{ CheckApprove(scope, "jcbmfzr").MessageText }}</template>
                  </div>
                  <div style="display: flex; align-items: center;padding: 0">
                    <div
                      style="
                        display: flex;
                        align-items: center;
                        width: 55mm;
                        margin-left: 10mm;
                      "
                    >
                      <input
                        type="checkbox"
                        :checked="checkHistoryNodeComment(scope, 'jcbmfzr').type == 1
                        "
                      />同意
                    </div>
                    <div
                      style="
                        display: flex;
                        align-items: center;
                        width: 55mm;
                        margin-left: 10mm;
                      "
                    >
                      <input
                        type="checkbox"
                        :checked="checkHistoryNodeComment(scope, 'jcbmfzr').type == 3
                        "
                      />不同意
                    </div>
                  </div>
                </div>
                <div style="display: flex; justify-content: end">
                  <div style="width: 41mm; position: relative">
                    签名：
                    <template v-if="CheckApprove(scope, 'jcbmfzr').ShowImg">
                      <img
                        style="width: 80px; position: absolute; top: -10px"
                        :src="CheckApprove(scope, 'jcbmfzr').ApproveImg"
                      />
                    </template>
                  </div>
                  <div style="width: 50mm">
                    日期：
                    {{ checkHistoryNode(scope, "jcbmfzr").endTime }}
                  </div>
                </div>
              </div>
            </td>
          </tr>
          <tr>
            <td colspan="11">
              <div>
                <div style="display: flex; align-items: center; position: relative">
                  技术负责人意见：
                  <div
                    style="
                      position: absolute;
                      top: 20px;
                      left: 150px;
                      text-align: left;
                    "
                  >
                    <template
                      v-if="CheckApprove(scope, 'jsfzr').ShowMessage"
                    >{{ CheckApprove(scope, "jsfzr").MessageText }}</template>
                  </div>
                  <div style="display: flex; align-items: center">
                    <div
                      style="
                        display: flex;
                        align-items: center;
                        width: 55mm;
                        margin-left: 13mm;
                      "
                    >
                      <input
                        type="checkbox"
                        :checked="checkHistoryNodeComment(scope, 'jsfzr').type == 1
                        "
                      />同意
                    </div>
                    <div
                      style="
                        display: flex;
                        align-items: center;
                        width: 55mm;
                        margin-left: 10mm;
                      "
                    >
                      <input
                        type="checkbox"
                        :checked="checkHistoryNodeComment(scope, 'jsfzr').type == 3
                        "
                      />不同意
                    </div>
                  </div>
                </div>
                <div style="display: flex; justify-content: end">
                  <div style="width: 41mm; position: relative">
                    签名：
                    <template v-if="CheckApprove(scope, 'jsfzr').ShowImg">
                      <img
                        style="width: 80px; position: absolute; top: -10px"
                        :src="CheckApprove(scope, 'jsfzr').ApproveImg"
                      />
                    </template>
                  </div>
                  <div style="width: 50mm">日期：{{ checkHistoryNode(scope, "jsfzr").endTime }}</div>
                </div>
              </div>
            </td>
          </tr>
        </table>
        <!-- 底部信息位置 -->
        <div class="page-bottom" style="page-break-after: always">
          <div class="desc">说明：Ⅰ类为通用类，Ⅱ类为专用类，Ⅲ类为工具类</div>
          <div class="desc">注：本表格自2024年2月1日起生效</div>
        </div>
      </template>
    </PrintBox>
    <!-- 导入对话框 -->
    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
      <el-upload
        ref="upload"
        :limit="1"
        accept=".xlsx, .xls"
        :headers="upload.headers"
        :action="upload.url + '?updateSupport=' + upload.updateSupport"
        :disabled="upload.isUploading"
        :on-progress="handleFileUploadProgress"
        :on-success="handleFileSuccess"
        :auto-upload="false"
        drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">
          将文件拖到此处，或
          <em>点击上传</em>
        </div>
        <div class="el-upload__tip text-center" slot="tip">
          <!-- <div class="el-upload__tip" slot="tip">
            <el-checkbox v-model="upload.updateSupport" />
            是否更新已经存在的用户数据
          </div>-->
          <span>仅允许导入xls、xlsx格式文件。</span>
          <el-link
            type="primary"
            :href="baseUrl +
            '/data/2023/07/05/6e5555730000408cbf3815e41196273f/校准费用导入模板.xls'
            "
            style="font-size: 12px; vertical-align: baseline"
          >下载模板</el-link>
        </div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listDeviceCheckAsk,
  delDeviceCheckAsk
} from "@/api/device/deviceCheckAsk.js";
import { deptTreeSelect } from "@/api/system/user.js";
import printStyle from "@/utils/print.js";
import { getToken } from "@/utils/auth";
import { listTodoProcess } from "@/api/workflow/process";
export default {
  dicts: [
    "sys_device_type",
    "sys_device_content",
    "sys_trace_method",
    "sys_site_list"
  ],
  name: "buy",
  data() {
    return {
      // 导入参数
      upload: {
        // 是否显示弹出层（用户导入）
        open: false,
        // 弹出层标题（用户导入）
        title: "",
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的用户数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: { Authorization: "Bearer " + getToken() },
        // 上传的地址
        url:
          process.env.VUE_APP_BASE_API +
          "/system/deviceCheckCert/importDeviceCheckCertData"
      },
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      dataList: [],
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      deptOptions: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        deviceName: undefined,
        operUserId: undefined,
        licenseNum: undefined,
        checkDate: null,
        deptId: []
      },
      // 日期范围
      dateRange: [],

      userList: [],
      deptOptions: [],
      infos: [], //勾选的数据
      printList: [],
      baseUrl: this.$VUE_APP_IMG_API
    };
  },
  created() {
    const str = sessionStorage.getItem("queryParams");
    if (str) {
      this.queryParams = JSON.parse(str);
      if (this.queryParams.startEndDate) {
        this.dateRange.push(
          this.queryParams.startEndDate,
          this.queryParams.endEndDate
        );
      }
      setTimeout(() => {
        sessionStorage.removeItem("queryParams");
      }, 500);
    }
    this.getList();
    this.getDeptTree();
  },
  methods: {
    handleClone(row) {
      sessionStorage.setItem("queryParams", JSON.stringify(this.queryParams));
      if (this.infos[0].status != "end") {
        this.$message.warning("只能克隆已完成的数据");
        return;
      }
      const configId = row.deviceCheckAskId || this.ids;

      this.$router.push(
        "./addDeviceCheckAsk?isClone=true&id=" +
          configId +
          "&value=1" +
          "&flag=克隆"
      );

      // const findex = this.fileList.map((f) => f.name).indexOf(file.name);
      // if (findex > -1) {
      //   this.fileList.splice(findex, 1);
      //   this.$emit("input", this.listToString(this.fileList));
      // }
    },
    printBox() {
      //infos  勾选的数据 如果有勾选就打印勾选。
      if (this.infos.length) {
        this.printList = this.infos;
      } else {
        //反之打印当前整个列表
        this.printList = this.dataList;
      }
      setTimeout(() => {
        document.title = "仪器设备计量检定要求表 STET/B/22-6";

        this.$print({
          printable: "printBox", //打印区域id
          type: "html", //打印类型是html
          scanStyles: false,
          targetStyles: ["*"],
          style: this.workStyle(),
          onPrintDialogClose: () => {
            document.title = process.env.VUE_APP_TITLE;
          }
        });
      }, 500);
    },
    // 可以自定义样式  printStyle 是公共样式 切勿私自修改
    workStyle() {
      return `${printStyle}
        table,
        table tr th,
        table tr td {
          padding: 4px;
        }
        .desc{
        text-align: left; font-size: 12px; margin-top: 0px
      }
            .df {
                display: flex;
              }
      `;
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.deviceCheckAskId);
      this.single = selection.length != 1;
      this.infos = selection;
      this.multiple = !selection.length;
    },

    /** 修改按钮操作 */
    handleUpdate(row) {
      sessionStorage.setItem("queryParams", JSON.stringify(this.queryParams));

      const configId = row.deviceCheckAskId || this.ids;

      if (row.status == "draft") {
        this.$router.push(
          "./addDeviceCheckAsk?isEdit=true&id=" + configId + "&value=" + 1
        );
      } else {
        /** 查询流程定义列表 */
        // this.queryParams.piid = '24386aae-aba3-11ee-93cf-08bfb83e319c'
        // listTodoProcess({ pageNum: 1, pageSize: 1, piid:row.piid}).then(
        //   (response) => {
        //     // this.todoList = response.rows;
        //     // this.total = response.total;
        //     // this.loading = false;
        //   }
        // );
        // return
        this.$router.push({
          path: "/checkAsk/process/detail/" + row.piid,
          query: {
            definitionId: null,
            deployId: null,
            taskId: row.wfDetailVo.historyProcNodeList[1].commentList[0].taskId,
            // taskId:'093b3f8c-86cd-11ef-808b-549f35028508',
            procInsId:
              row.wfDetailVo.historyProcNodeList[1].commentList[0]
                .processInstanceId,
            // procInsId: '6dfe5440-8ac1-11ef-a049-549f35028508',
            finished: false,
            id: configId,
            value: 1,
            isEdit: true
          }
        });
      }
    },
    /** 查询部门下拉树结构 */
    getDeptTree() {
      deptTreeSelect().then(response => {
        this.deptOptions = response.data;
      });
    },
    handleRecord(row) {
      const configId = row.deviceCheckAskId || this.ids;
      let e = this.dataList.find(i => i.deviceCheckAskId == configId);
      this.$router.push(
        "./deviceCheckCert?id=" + configId + "&deviceId=" + e.deviceId
      );
    },
    handleDetail(row) {
      // this.$router.push(
      //   "./addDeviceCheckAsk?isInfo=true&id=" + row.deviceCheckAskId
      // );
      sessionStorage.setItem("queryParams", JSON.stringify(this.queryParams));

      if (row.status == "draft") {
        this.$router.push(
          "./addDeviceCheckAsk?isInfo=true&id=" + row.deviceCheckAskId
        );
      } else {
        this.$router.push({
          path: "/checkAsk/process/detail/" + row.piid,
          query: {
            definitionId: null,
            deployId: null,
            taskId: null,
            finished: false,
            id: row.deviceCheckAskId
          }
        });
      }
    },

    /** 删除按钮操作 */
    handleDelete(row) {
      const configId = row.deviceCheckAskId || this.ids;

      this.$modal
        .confirm('是否确认删除ID为"' + configId + '"的数据项？')
        .then(function() {
          return delDeviceCheckAsk(configId);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    handleAdd() {
      this.$router.push("./adddeviceCheckAsk");
    },
    /** 查询列表 */
    getList() {
      this.loading = true;

      listDeviceCheckAsk({
        ...this.addDateRangeTime(
          this.queryParams,
          this.dateRange,
          "startEndDate",
          "endEndDate"
        ),
        deptId: this.queryParams.deptId.slice(-1)[0]
      }).then(response => {
        this.dataList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },

    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    handleExport() {
      this.download(
        "system/deviceCheckAsk/export",
        {
          ...this.queryParams
        },
        `设备仪器计量检定审批记录表_${this.parseTime(
          new Date().getTime(),
          "{y}-{m}-{d}"
        )}.xlsx`
      );
    },
    /** 导入按钮操作 */
    handleImport() {
      this.upload.title = "导入校准费用";
      this.upload.open = true;
    },
    // 文件上传中处理
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true;
    },
    // 文件上传成功处理
    handleFileSuccess(response, file, fileList) {
      this.upload.open = false;
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
      this.getList();
    },
    // 提交上传文件
    submitFileForm() {
      this.$refs.upload.submit();
    },
    /** 下载模板操作 */
    importTemplate() {
      this.download(
        "system/user/importTemplate",
        {},
        `user_template_${new Date().getTime()}.xlsx`
      );
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.resetForm("queryForm");
      this.handleQuery();
    }
  }
};
</script>
<style lang="scss" scoped>
::v-deep .el-dialog__body {
  img {
    width: 100%;
  }
}
</style>
